/*
 * Copyright (C) 2005, Velocityme Partnership
 * DefaultGanttCategoryDataset.java
 *
 * Created on 24 October 2005, 06:46
 */

package com.velocityme.www.utility;

import org.jfree.data.category.DefaultIntervalCategoryDataset;
import org.jfree.data.gantt.GanttCategoryDataset;

/**
 *
 * @author  Robert
 */
public class DefaultGanttCategoryDataset extends DefaultIntervalCategoryDataset implements GanttCategoryDataset{
    
    private Number[][] m_percentages;
    
    /** Creates a new instance of DefaultGanttCategoryDataset */
    public DefaultGanttCategoryDataset(Comparable[] seriesKeys,
                                       Comparable[] categoryKeys,
                                       Number[][] starts,
                                       Number[][] ends,
                                       Number[][] percentages) {
        super(seriesKeys, categoryKeys, starts, ends);
        m_percentages = percentages;
    }
    
    public Number getEndValue(int row, int column, int subinterval) {
        return getEndValue(row, column);
    }
    
    public Number getEndValue(Comparable rowKey, Comparable columnKey, int subinterval) {
        return getEndValue(rowKey, columnKey);
    }
    
    public Number getPercentComplete(int row, int column) {
        return m_percentages[row][column];
    }
    
    public Number getPercentComplete(Comparable rowKey, Comparable columnKey) {
        int seriesIndex = getSeriesIndex(rowKey);
        int itemIndex = getItem(columnKey);
        return getPercentComplete(seriesIndex,itemIndex);
    }
    
    public Number getPercentComplete(Comparable rowKey, Comparable columnKey, int subinterval) {
        return getPercentComplete(rowKey,columnKey);
    }
    
    public Number getPercentComplete(int row, int column, int subinterval) {
        return getPercentComplete(row,column);
    }
    
    public Number getStartValue(Comparable rowKey, Comparable columnKey, int subinterval) {
        return getStartValue(rowKey, columnKey);
    }
    
    public Number getStartValue(int row, int column, int subinterval) {
        return getStartValue(row, column);
    }
    
    public int getSubIntervalCount(int row, int column) {
        return 1;
    }
    
    public int getSubIntervalCount(Comparable rowKey, Comparable columnKey) {
        return 1;
    }
    
}
